/**
 * 
 */
package org.youisoft.summer.evaluator.function;

import org.youisoft.summer.evaluator.InvokeException;
import org.youisoft.summer.evaluator.UnitEnum;
import org.youisoft.summer.evaluator.context.CalContext;

import org.youisoft.lifecircle.Destroyable;
import org.youisoft.lifecircle.Initilize;
import org.youisoft.summer.evaluator.operator.Operator;

/**
 * @author zijiang.jl
 *
 */
public interface Function extends Initilize,Destroyable{
	
	/**
	 * 
	 * @param type
	 */
	public void setType(UnitEnum type);
	
	/**
	 * 
	 * @return
	 */
	public UnitEnum getType();
	/**
	 * 
	 * @return
	 */
	public String getName();
	
	
	/**
	 * 
	 * @return
	 */
	public String[] getAlias();
	

	/**
	 * 
	 * @return
	 */
	public boolean isValidate();

	/**
	 * 
	 * @param <C>
	 * @param <R>
	 * @param <P>
	 * @param context
	 * @return
	 */
	public <C,R,P> boolean isIgnore(CalContext<C,R,P> context);
	
	
	/**
	 * 
	 * @return
	 */
	public boolean addendumOperator();
	
	/**
	 * 
	 * @param <C>
	 * @param context
	 * @param operator
	 * @return
	 */
	public <C,R,P> boolean supportOperator(CalContext<C,R,P> context,Operator<?> ... operator);
	
	/**
	 * 
	 * @param <C>
	 * @param context
	 * @param operator
	 * @return
	 */
	public <C,R,P> Operator<?> invoke(CalContext<C,R,P> context,Operator<?> ... operator) throws InvokeException;
	
	/**
	 * 
	 * @param <C>
	 * @param context
	 * @param callback
	 * @param operator
	 * @return
	 */
	public <C,R,P> Operator<?> invoke(CalContext<C,R,P> context,FunctionCallback callback,Operator<?> ... operator) throws InvokeException;

}
